using GraphQL.Types;
using GraphQLDemo.Domain.Orders;

namespace GraphQLDemo.Api.GroupTypes;

public class OrderPageGraphType : ObjectGraphType<Order>
{
    public OrderPageGraphType()
    {
        Name = "OrderPage";
        Description = "Order page test ... ";

        Field<StringGraphType>("number")
            .Resolve(context =>
            {
                context.Source.Number = "1";
                return context.Source.Number;
            });
        Field(o => o.Price);
        Field(o => o.StatusType);
        Field(o => o.CreationTime);
    }
}